using System.Collections;
using System.Collections.Generic;

namespace Sunny.UI;

public class NullableDictionary<TKey, TValue> : Dictionary<TKey, TValue>, IDictionary<TKey, TValue>, ICollection<KeyValuePair<TKey, TValue>>, IEnumerable<KeyValuePair<TKey, TValue>>, IEnumerable
{
	public new TValue this[TKey item]
	{
		get
		{
			if (!TryGetValue(item, out var value))
			{
				return default(TValue);
			}
			return value;
		}
		set
		{
			base[item] = value;
		}
	}
}
